package serveur;

import java.util.ArrayList;
import java.util.List;


public class Partie
{
	private int[][] matrix;
	private int nbTour;
	private int tailleMatric;
	private Player player1;
	private Player player2;
	private String mode;
	private List<String> listplayer = new ArrayList<String>();

	public Partie( Player player1, Player player2, int[][] matrix,int nbTour ,String mode,int tailleMatric)
	{
		this.player1 = player1;
		this.player2 = player2;
		this.matrix = matrix;
		this.nbTour=nbTour;
		this.tailleMatric=tailleMatric;
		this.mode=mode;
		listplayer.add(player1.getNom());
		listplayer.add(player2.getNom());

	}
	
	public int GetValueFromMatrix(int ligne, int colonne )
	{	
		return matrix[ligne][colonne];
	}
	
	public boolean IsExist(String pl1, String pl2 )
	{
		return (listplayer.contains(pl1) && listplayer.contains(pl2));
	}
	public Player getPlayer1 ()
	{
		return player1;
	}
	
	public Player GetPlayer( String nom )
	{
		if( player1.getNom().equals(nom))
			return player1;
		else
		{
			assert player2.getNom().equals(nom);
			return player2;
		}
	}

	public void setPlayer1 ( Player player1 )
	{
		this.player1 = player1;
	}

	public Player getPlayer2 ()
	{
		return player2;
	}

	public void setPlayer2 ( Player player2 )
	{
		this.player2 = player2;
	}

	public int getNbTour ()
	{
		return nbTour;
	}
	
	public int getTailleMatric(){
		return tailleMatric;
	}
	public void setTailleMatric(int tailleMatric){
		this.tailleMatric=tailleMatric;
	}

	public void setNbTour ( int nbTour )
	{
		this.nbTour = nbTour;
	}
	public String getMode ()
	{
		return mode;
	}

	public void setMode ( String mode )
	{
		this.mode = mode;
	}
	public int[][] getMatrice ()
	{
		return matrix;
	}

	public void setMatrice ( int[][] matrix )
	{
		this.matrix = matrix;
	}
	public void setListplayer ( List<String> listplayer )
	{
		this.listplayer = listplayer;
	}
	public List<String> getListplayer ()
	{
		return listplayer;
	}
}

